import request from "./request"
import { backend } from "./index"
export const memberLogin = function (data) {
	return request("get", backend + "/member/dudumember/data", data)
}
//获取字典列表
export const dictList = function (data) {
	return request("get", backend + "/api/system/dict/listByCode", data)
}
//发送验证码
export const sendCode = function (data) {
	return request("post", backend + "/api/sendCode", data)
}

//会员免注册或登录
export const memberRegister = function (data) {
	return request("post", backend + "/api/member/codeLogin", data)
}

// 账号密码登录
export const userLogin = function (data) {
	return request("post", backend + "/api/member/login", data)
}

// 用户信息
export const userInfo = function () {
	return request("get", backend + "/userInfo")
}

// 保存银行卡
export const saveBankCard = function (data) {
	return request("post", backend + "/api/member/memberBankCard/save", data)
}
// 获取会员的银行卡
export const bankCardList = function (data) {
	return request("get", backend + "/api/member/memberBankCard/listByMember", data)
}
//获取地址
export const getAdress = function (data) {
	return request("get", backend + "/api/system/sysRegion/list", data)
}
//保存会员实名信息
export const saveRealInfo = function (data) {
	return request("post", backend + "/api/member/memberRealinfo/save", data)
}
// 身份证ocr识别
export const idCardOcr = function (data) {
	return request("post", backend + "/api/member/memberRealinfo/icCardOcr", data)
}
// 获取帮助中心类型
export const helpArticleTypeList = function (data) {
	return request("get", backend + "/api/system/castleHelpArticleType/list", data)
}
// 用帮助中心类型id获取帮助中心文章
export const helpArticleListByType = function (data) {
	return request("get", backend + "/api/system/castleHelpArticle/listByType", data)
}
// 获取帮助文章详情
export const helpArticleInfo = function (data) {
	return request("get", backend + "/api/system/castleHelpArticle/info", data)
}
// 搜索帮助中心文章 返回文章类型
export const searchHelpList = function (data) {
	return request("get", backend + "/api/system/castleHelpArticleType/searchList", data)
}
// 根据编号获取协议
export const getProtocol = function (code) {
	return request("get", backend + "/api/system/protocol/getByCode", {
		code: code,
	})
}

//商品模块开始

//商品分页
export const pageGoods = function (data) {
	return request("get", backend + "/api/goods/goods/page", data)
}
//商品详情
export const infoGoods = function (data) {
	return request("get", backend + "/api/goods/goods/info", data)
}
//商品模块结束

//用户反馈模块开始
export const submitFeedBack = function (data) {
	return request("post", backend + "/api/system/feedback/save", data)
}

//用户反馈模块结束

//用户地址模块开始

//用户地址列表
export const listAddress = function (data) {
	return request("get", backend + "/api/member/memberAddress/list", data)
}
//保存地址
export const saveAddress = function (data) {
	return request("post", backend + "/api/member/memberAddress/save", data)
}
//修改默认地址
export const changeDefaultAddress = function (data) {
	return request("post", backend + "/api/member/memberAddress/changeDefaultAddress", data)
}
//删除地址
export const deleteAddress = function (data) {
	return request("get", backend + "/api/member/memberAddress/delete", data)
}
export const infoAddress = function (data) {
	return request("get", backend + "/api/member/memberAddress/info", data)
}
//修改地址
export const editAddress = function (data) {
	return request("post", backend + "/api/member/memberAddress/edit", data)
}
//用户地址模块结束

//表单模块开始
// 获取省市区
export const region = function (data) {
	return request("get", backend + "/system/sysRegion/tree", data)
}
// 获取验证码
export const code = function (data) {
	return request("post", backend + "/formManage/getCode", data)
}

// 获取可访问表单列表
export const dynamicFormList = function (data) {
	return request("get", backend + "/form/formConfig/page", data)
}
// 获取动态表单
export const dynamicStateForm = function (id) {
	return request("get", backend + "/form/formConfig/info?id=" + id)
}
//表单模块结束

/**
 * 流程模块开始
 */
// 获取流程列表,审批应用
export const flowList = function (data) {
	return request("get", backend + "/flowable/approves/pageList", data)
}

// 已提交--类型
export const flowConfigList = function (data) {
	return request("get", backend + "/flowable/flowableTemplate/page", data)
}

// 流程表单info
export const flowFormInfo = function (id) {
	return request("get", backend + "/flowable/form/flowableFormConfig/info?id=" + id)
}
// 获取流程的审批人
export const flowApproveUser = function (data) {
	return request("get", backend + "/flowable/approves/allParticipants", data)
}

// 已处理列表(我已审批的)
export const finishTasks = function (data) {
	return request("get", backend + "/flowable/approves/finishTasks", data)
}

// 审核状态
export const approveStatus = function (data) {
	return request("get", backend + "/system/enums/list?enumName=ApproveStatus&moduleName=flowable", data)
}

// 抄送我
export const copyTasksToMe = function (data) {
	return request("get", backend + "/flowable/approves/csToMe", data)
}
// 我发起的（已提交的列表）
export const myTasksList = function (data) {
	return request("get", backend + "/flowable/approves/myTasks", data)
}

// 我审批的--审批中
export const myApproveTasks = function (data) {
	return request("get", backend + "/flowable/approves/todoTasks", data)
}

// 选择审核人
export const getComponentList = function (data) {
	return request("get", backend + "/system/sysDept/componentList", data)
}

// 审核信息
export const infoApproves = function (data) {
	return request("get", backend + "/flowable/approves/info", data)
}
// 待审批--提交审批

export const completeTask = function (data) {
	return request("post", backend + "/flowable/approves/completeTask", data)
}

// 抄送人类型 00不允许指定抄送人 01 允许指定抄送人
export const csOptional = function (data) {
	return request("get", backend + "/flowable/approves/csOptional", data)
}

// 选择人员或部门
export const nameForCom = function (data) {
	return request("post", backend + "/system/sysDept/nameForCom", data)
}
// 委派
export const delegateTask = function (data) {
	return request("post", backend + "/flowable/approves/delegateTask", data)
}

/**
 * 流程模块结束
 */
